<?php
/**
 *
 * PHP versions 4 and 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       cake
 * @subpackage    cake.cake.console.libs.templates.skel.views.layouts
 * @since         CakePHP(tm) v 0.10.0.1076
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
?>
<!DOCTYPE html>
<!--
 The above DOCTYPE is for HTML5. I'm tyring it since I need to make custom html attributes in my form. 
 The below DOCTYPE was the original doctype included.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<?php echo $this->Html->charset(); ?>
	<title>
		<?php __('ImageRecon - '); ?>
		<?php echo $title_for_layout; ?>
	</title>
	<?php
		echo $this->Html->meta('icon');
    
    //$options = array('once'=>true);
    //echo $this->Html->script('https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js',
    //                                                $options);
    
    echo $this->LessCss->cssLinkFromLess('default.less');
    //echo $this->Html->css('cake.generic');
    
    echo $this->Html->css('main_menu');
    
    echo $this->Html->script('jquery-1.6.2.js');
    // TEMP - just trying to get accordian to work on form.ctp
    //echo $this->Html->script('libs/Elfinder1.2/js/jquery-ui-1.8.13.custom.min.js');
    //echo $this->Html->css("/js/libs/Elfinder1.2/css/smoothness/jquery-ui-1.8.13.custom.css",null);
    //echo $this->Html->css("jquery-ui-1.8.16.custom.babyBlueGray.css");
    //echo $this->Html->script('jquery-ui-1.8.16.custom.babyBlueGray.min.js');
    echo $this->Html->css("jquery-ui-1.8.16.custom.blackOriented.css");
    echo $this->Html->script('jquery-ui-1.8.16.custom.blackOriented.min.js');
        
    echo $this->Html->script('libs/jQueryTools/jquery.tools.min-MostTools.js');
    
    echo $this->Html->script('libs/jQueryPurr/jquery.purr.js');
    echo $this->Html->script('libs/jquery.blockUI.js');
    
    echo $this->Html->script('modal_onload.js');
    // Provide path info for Elfinder and the Fiji Ajax method in the Controller 
    // (they both get initialized in default.js)
    ?>
    <script type="text/javascript">
      var elfinderConnectorPath = "<?php echo GlobalsClass::getElfinderConnectorPath(); ?>";
      var fijiAjaxLauncherUrl   = "<?php echo GlobalsClass::getFijiAjaxLauncherUrl();   ?>";
    </script>
    
    <?php
    echo $this->Html->script('default.js');
    
    //echo $this->Html->script('libs/fixed-header-table/jquery.fixedheadertable.min.js');
  
    echo $scripts_for_layout;    

    

    // <editor-fold defaultstate="collapsed" desc="Pull in CSS & JS files that are specific to a Controller and/or Controller/Action">
    /////////////////////////////////////////////////////////////////////////////////////////////
    //// Pull in CSS files specific to a Controller and/or a Controller/Action respectively. ////
    // webroot/css/contoller_name.css
    if(is_file(WWW_ROOT . 'css' . DS . $this->params['controller'] . '.less')) {
      echo $this->LessCss->cssLinkFromLess($this->params['controller']); 
    }
    else if (is_file(WWW_ROOT . 'css' . DS . $this->params['controller'] . '.css')) {
      echo $html->css($this->params['controller']);
    }    
    // webroot/css/contoller_name/action_name.css (or ".less")
    if (is_file(WWW_ROOT . 'css' . DS . $this->params['controller'] . DS . $this->params['action'] . '.less')) {
      //die("default.ctp about to call cssLinkFromLess() on: ". $this->params['controller'] . '/' . $this->params['action']);
      echo $this->LessCss->cssLinkFromLess($this->params['controller'] . '/' . $this->params['action']);
    }
    else if (is_file(WWW_ROOT . 'css' . DS . $this->params['controller'] . DS . $this->params['action'] . '.css')) {
      echo $html->css($this->params['controller'] . '/' . $this->params['action']);
    }

    /////////////////////////////////////////////////////////////////////////////////////////
    //// Pull in JS files specific to a Controller and/or a Controller/Action ///////////////
    // webroot/js/contoller_name.js
    if (is_file(WWW_ROOT . 'js' . DS . $this->params['controller'] . '.js')) { 
      echo $this->Html->script($this->params['controller']);
    }
    // webroot/js/contoller_name/action_name.js
    if (is_file(WWW_ROOT . 'js' . DS . $this->params['controller'] . DS . $this->params['action'] . '.js')) { 
      echo $this->Html->script($this->params['controller'] . '/' . $this->params['action']);
    }// </editor-fold>

    // Make ELFINDER available in all views. Note we must first include jQuery js and jQuery UI js and css.
		$this->Elfinder->importElfinder();
	?>
    
</head>
<body>
	<div id="container">
		<div id="header" class="center">
      <?php 
      // Logo
      $slogan = "Put humpty dumpty back together again!";
      $options = array('id'=>'logo_reflect', 'class'=>'logo', 'title'=>$slogan);
      // Wrap the Logo in a link to the landing page
      echo $this->Html->link(
        $this->Html->image('Logos/OrangeWhite/Reflect/260x80.png', $options),
        array('controller'=>'jobs', 'action'=>'landing'),
        array('escape'=>false) // don't convert html in the image to 'html entities', just put the <img> there!
      );

      // MAIN MENU element
      echo $this->element('main_menu'); // be sure to also include the main_menu.css file in <head>
      ?>

		</div>
		<div id="content">

			<?php 
        // Output all flash messages (see my method addFlashMsg() in app_controller)
        $messages = $this->Session->read('Message.multiFlash');
        // if there are flash messages to be displayed
        if($messages || $this->Session->check('Message.flash')) { // then output the div#messages...
          // wrapper for the flash messages
          echo "<div id='messages' class='modal onload'>";

              // the standard messages
              echo $this->Session->flash();
              // multiple messages
              if($messages = $this->Session->read('Message.multiFlash')) {
                foreach($messages as $k=>$msgArray) {
                  echo $this->Session->flash('multiFlash.'.$k); // uses my Cake 'element' customFlashMessage
                }
              }
          echo "</div>"; // end div#messages
        } // end if there are flash messages to be displayed
     ?>

      
			<?php echo $content_for_layout; ?>

      <!--  ELFINDER -------------------------------------------------- -->
      <div id="file_exp_container" class="modal">
        <!--  <div id="file_exp" class="modal"></div>-->
        <div id="file_exp"></div>
      </div>
      
      
		</div>
		<div id="footer">
			
		</div>
	</div>
	<?php echo $this->element('sql_dump'); ?>
  <?php echo $this->Js->writeBuffer(); // write out cached Js helper scripts ?>
</body>
</html>